<template>

   <div class='basefile_create'>
    <el-page-header @back="goBack" content="新增应用"> </el-page-header>
    <el-form label-width="80px" size="small">
      <el-form-item label="名称">
        <el-input v-model="form.id"></el-input>
      </el-form-item>
      <el-form-item label="名称">
        <el-input v-model="form.fileName"></el-input>
      </el-form-item>
      <el-form-item label="组名">
        <el-input v-model="form.groupName" ></el-input>
      </el-form-item>
            <el-form-item label="上传时间">
        <el-input v-model="form.uploadTime" ></el-input>
      </el-form-item>
      <el-form-item label="扩展名">
        <el-input v-model="form.extName" ></el-input>
      </el-form-item>
            <el-form-item label="文件大小">
        <el-input v-model="form.fileSize" ></el-input>
      </el-form-item>
            <el-form-item label="文件类型">
        <el-input v-model="form.fileType" ></el-input>
      </el-form-item>
      <el-form-item style="text-align:right">
        <el-button type="primary" @click="submitHandler">提交</el-button>
      </el-form-item>
    </el-form>
  </div>
</template>

<script>
import { post } from '@/utils/request'
export default {
  //组件名称
  name:'demo',
  //组建参数，接受来自父组件的数据
  props:{},
  //组件状态值
  data(){
    return{
      form:{}
    }
  },

  //计算属性
  computed:{},
  //侦听器
  watch:{},
  //组件方法
  methods:{
submitHandler(){
        // 1. 获取参数  this.form
      // 2. 将参数提交给后台
      let url = "http://121.196.106.124:8888/base_file/saveOrUpdate"
      post(url,this.form).then(resp => {
        // 提示用户录入完成
        this.$message({type:"success",message:resp.message})
        // 返回，展示
        this.goBack();
      })
    },
    goBack(){
      this.$router.back();
    }
  },
    created(){
    this.form = this.$route.query
  },
  }
</script>

<style>

</style>